<?php $this->load->view('layout/header'); ?>

<script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
        theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
</script>
<script type="text/javascript">
    //<![CDATA[
    function WebForm_OnSubmit() {
        if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
        return true;
    }
    //]]>
</script>
<form name="form1" method="post" action="<?php echo b_url('wechat/menu_action/').$info['menu_id']?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
    <div>
    </div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>菜单
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * 菜单级别：
                </td>
                <td>
                    <?php if($info['menu_parent'] == 0){
                        echo '主菜单(注:如主菜单下还需添加子菜单,菜单响应动作为不选)';
                    }else{
                        echo '子菜单';
                    } ?>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * 菜单标题：
                </td>
                <td>
                    <input name="menu_title" type="text" value="<?php echo $info['menu_title']?>" id="menu_title" />
                    <span id="menu_title_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * 菜单响应动作：
                </td>
                <td>
                    <input type="radio" name="menu_action" value="view" <?php if($info['menu_action']=='view'){echo "checked"; }?>>view
                    <input type="radio" name="menu_action" value="click" <?php if($info['menu_action']=='click'){echo "checked"; }?>>click
                    <input type="radio" name="menu_action" value="" <?php if($info['menu_action']==''){echo "checked"; }?>>不选
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * 链接地址(view)：
                </td>
                <td>
                    <input name="menu_url" type="text" value="<?php echo $info['menu_url']?>" id="menu_url" />
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * 菜单Key值(click)：
                </td>
                <td>
                    <input name="menu_key" type="text" value="<?php echo $info['menu_key']?>" id="menu_key" />
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td>
                    <input type="submit" value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button" value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
        $('#form1').submit(function() {
            var is = true;
            if (!input_tips($('#menu_title'))) {
                is = false;
            }
            return is;
        });
    </script>
    </body>
    </html>